<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>datagrid原生使用_夏小蕾</title>
    <link rel="stylesheet" href="./frame/easyui/themes/bootstrap/easyui.css">
    <link rel="stylesheet" href="./frame/easyui/themes/icon.css">
    <link rel="stylesheet" href="./frame/bootstrap/css/bootstrap.min.css">
</head>

<body>
    <table id='tableUser' class='table'>
        <thead> 
            <th>用户名</th>
            <th>年龄</th>
            <th>邮箱</th>
            <th>手机号码</th>
        </thead>
        <tbody> 

        </tbody>
    </table>
        <button type="button" class="btn btn-default" >LOAD</button>
    <script src='./frame/jquery-3.3.1.min.js'></script>
    <script src='./frame/easyui/jquery.easyui.min.js'></script>
    <script>
        function createRow(row){
            var tr=$('<tr></tr>')
            var td=$('<td></td>')
            $.each(row,function(key,value){
               var td=$('<td></td>').html(value)
               tr.append(td)
            })
            return tr
        }
      $.get('/user/list').done(function(result){
            $(result.data).each(function(index,value){
                $('#tableUser tbody').append(createRow(value))
            })
      })
    </script>
</body>

</html>